package net.hn.hnms.biz.energy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.hn.hnms.biz.energy.domain.ElectricityPlacePrice;
import net.hn.hnms.biz.energy.vo.ElectricityPlacePriceVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ElectricityPlacePriceMapper extends BaseMapper<ElectricityPlacePrice> {
    @Update("<script>" +
            " update  electricity_place_price set  del_flag = '1' " +
            " where electricity_place_id in" +
            " <foreach collection=\"list\" item=\"value\" separator=\",\" open=\"(\" close=\")\">\n" +
            "#{value}" +
            "</foreach>" +
            "</script>")
    void updateDeleteByIds(@Param("list") List<String> list);

    @Select("<script> select sum(magnification) as electricalLoadCount from electricity_place_price where mine_code=#{mineCode} and del_flag='0' </script>")
    ElectricityPlacePriceVo getElectricityPlacePriceByMineCode(@Param("mineCode") String mineCode);

}
